define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'order/index',
        add_url: 'order/add',
        edit_url: 'order/edit',
        delete_url: 'order/delete',
        export_url: 'order/export',
        modify_url: 'order/modify',
    };

    return {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'id'},
                    {field: 'third_number', title: '聚合支付平台订单号'},
                    {field: 'sys_number', title: '支付系统订单号'},
                    {field: 'call_number', title: '调用方订单号'},
                    {field: 'app_type', search: 'select', selectList: notes?.app_type || {}, title: '第三方平台类型'},
                    {field: 'appid', title: 'appid'},
                    {field: 'merchant_no', title: '商户号'},
                    {field: 'create_time', search: 'range', title: '创建时间'},
                    {field: 'total_amount', title: '订单金额(元)', templet: function (res) { return res.total_amount/100 } },
                    {field: 'pay_amount', title: '支付金额(元)', templet: function (res) { return res.pay_amount/100 }},
                    {field: 'settle_type', search: 'select', selectList: notes?.settle_type || {}, title: '结算类型'},
                    {field: 'status', search: 'select', selectList: notes?.status || {}, title: '订单状态'},
                    {width: 250, title: '操作', templet: ea.table.tool},

                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
});